#!/bin/bash

echo  "请输入你要统计的名次的详细信息"
read -p "please input your number :" num

echo  "请输入你的文件路径和文件名"
read -p "please input your path to the file name :" path
for i in `seq $num`
do
	
ip=`cat $path |cut -d " " -f 1|sort |uniq -c|sort     -nr|head |cat -n |tr -s " "|cut -d " " -f 4|head -$i|tail -n +$i`

cs=`cat /lianxi/access_log |cut -d " " -f 1|sort |uniq -c|sort         -nr|head |cat -n |tr -s " "|cut -d " " -f 3|head -$i|tail     -n +$i`
	echo "第 $i 名是 $ip 访问次数: $cs"

done



